<!-- 	
		The home page view : app/views/resumes/home.html.erb
		controller: resume, action: home
		URL or URL/home 	- when user is logged in
-->

<link rel="stylesheet" type="text/css" href="/stylesheets/resumes/home.css" />	

<div id="content">

	<%= render :partial => "heading.html.erb" , :locals => {:user=> @user, :resume => @resume } %> 

	<% form_tag('', :method => "post") do %>	<!-- for authenticity token -->
	<div id="all_resumes_container">

		<% if @resumes.size != 0 %>
		<% @resumes.each do |resume| %>

			<% rtemplate = Rtemplate.find(:first, :conditions => ["id =?",resume.rtemplate_id]) %>
			<% publish_msg = (resume.public_status=='public') ? 'published' : 'publish' %>
			
			<div id=<%= 'resume_'+resume.id.to_s %> class="each_resume">
				
				<div class="thumbnail">
					<a href ="<%=h '/preview/'+resume.title+'/'+rtemplate.name %>" title="Click to preview" target="_blank">
						<img src="<%=h rtemplate.thumbnail_url %>" alt="thumbnail">
					</a>	
				</div>
				
				<div class="other_details">
				
					<div class="each_resume_heading">
						<div class="resume_title">
							<%= link_to resume.title, '/show/'+resume.title %>
						</div>
					</div>

					<div class="updated_at">
						updated <%=h resume.updated_at.to_s(:long) %>
					</div>
					
					<div class="desc">
						<p><%=h resume.meta_desc %></p>
					</div>

					
					<div class="actions">
						<div class="action_item quick_edit">	
							<%= link_to 'quick-edit', '/edit3/'+resume.title %>
						</div>
						<div class="action_item print_resume">
							<%= link_to 'view', '/show_p/'+resume.title, {:target => "_blank"}  %>
						</div>
						<div class="action_item pdf_resume">
							<%= link_to 'get-pdf', '/makepdf/'+resume.title, {:target => "_blank"} %>	
						</div>
						<div class="action_item rtemplate">
							<%= link_to 'change-template', '/show/'+resume.title+'#templates' %>
						</div>
						<div class="action_item public_status">
							<%= link_to publish_msg, '/show/'+resume.title+'#publish' %>
						</div>
						<div class="action_item delete_resume">	
							<%= link_to 'delete', '/show/'+resume.title+'#delete_resume' %>
						</div>
					</div>
				</div> <!-- /other_details -->
				
			</div> 	<!-- /each_resume -->
			
		<% end #loop %>
		<% else %>	
			<div id="no_resume_block">
				<div class="info">
					This place lists resumes you have created. <br/>
					There isn't one yet.
				</div>
				<div class="create_new">
					<%= link_to 'create a resume', '/new', {:class => "new_resume_button" } %>
				</div>
			</div>	
		<% end #if %>

	</div>	<!-- /all_resumes_container -->
	<% end #form %>

</div> <!-- /content -->

<% if RAILS_ENV == "production" %>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="/javascripts/jquery.tipTip.minified.js"></script>
<script type="text/javascript" src="/javascripts/jquery.jgrowl_minimized.js"></script>
<script type="text/javascript" src="/javascripts/resume_common.js"></script>
<script type="text/javascript" src="/javascripts/resumes/home.js"></script>	
<% end %>

<% if RAILS_ENV == "development" %>	
<script type="text/javascript" src="/javascripts/jquery-1.3.2.js"></script>
<script type="text/javascript" src="/javascripts/jquery.tipTip.js"></script>
<script type="text/javascript" src="/javascripts/jquery.jgrowl.js"></script>
<script type="text/javascript" src="/javascripts/resume_common.js"></script>
<script type="text/javascript" src="/javascripts/resumes/home.js"></script>
<% end %>